package com.yu.exception;

public class CommonException
{
    /**
     * 自定义异常FindDoctorException
     */
    private static final long serialVersionUID = -3636586326641591817L;
    
    public CommonException(int errorCode)
    {
        super();
        this.errorCode = errorCode;
    }
    
    public CommonException(int errorCode, String errorMessage)
    {
        this(errorCode);
        this.errorMessage = errorMessage;
    }
    
    /**
     * 错误返回码
     */
    private int errorCode;
    
    /**
     * 错误描述信息
     */
    private String errorMessage;
    
    /**
     * 重载toString方法
     */
    public String toString()
    {
        StringBuffer sb = new StringBuffer();
        sb.append("errorCode: ").append(errorCode);
        sb.append("errorMessage: ").append(errorMessage).append('\n');
        sb.append(super.toString());
        return sb.toString();
    }
    
    public int getErrorCode()
    {
        return errorCode;
    }
    
    public void setErrorCode(int errorCode)
    {
        this.errorCode = errorCode;
    }
    
    public String getErrorMessage()
    {
        return errorMessage;
    }
    
    public void setErrorMessage(String errorMessage)
    {
        this.errorMessage = errorMessage;
    }

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
